#include "guiserver.hpp"

GUIServer::GUIServer() : Server()
{
	show();
	
	QVBoxLayout *layout = new QVBoxLayout();
	QLabel *label = new QLabel("Server");
	edit = new QTextEdit();
        edit->setReadOnly(true);
	QPushButton *buttonQuit = new QPushButton("Quit");
	
	
	layout->addWidget(label);
	layout->addWidget(edit);
	layout->addWidget(buttonQuit);
	setLayout(layout);
	
        QObject::connect(buttonQuit, SIGNAL(clicked()), qApp, SLOT(quit()));
	qDebug() << "Server graphique.";
}

void GUIServer::display(QString s)
{
	edit->append(s);
	Server::display(s);
}
